package com.blog.utils;

import com.qiniu.util.Auth;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;


/**
 * @description: 七牛云上传图片
 **/
@Data
@AllArgsConstructor
@Slf4j
public class QiniuOssUtil {

    private String accessKey ;
    private String secretKey ;
    private String bucketName;

    /**
     * 七牛云上传的凭证
     */
    public static String createQiniuUpToken(String accessKey,String secretKey,String bucket){
        Auth auth = Auth.create(accessKey, secretKey);
        String upToken = auth.uploadToken(bucket);
        return upToken;
    }

}

